// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import App from './App';
import router from './router';
import VueRouter from 'vue-router';
import echarts from 'echarts';

import firstHM from './components/firstHM';

import introducePage from './components/introducePage.vue';
import routerPage from './components/routerPage.vue';
import homePage from './components/homePage.vue';
import audiencePage from './components/audiencePage.vue';
import producerPage from './components/producerPage.vue';



import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

import axios from 'axios';

Vue.config.productionTip = false;
Vue.use(ElementUI);
//需要挂载到Vue原型上
Vue.prototype.$echarts = echarts;
require('echarts-wordcloud');
/* eslint-disable no-new */

const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
	return originalPush.call(this, location).catch(err => err);
};


const routes = [
	{ path: '/', redirect: '/introducePage' }, // 默认就跳转此页面
	{
		path: '/firstHM',
		component: firstHM
	},
	{
		path: '/introducePage',
		component: introducePage
	},
	{
		path: '/routerPage',
		component: routerPage
	},
	{
		path: '/homePage',
		component: homePage
	},
	{
		path: '/audiencePage',
		component: audiencePage
	},
	{
		path: '/producerPage',
		component: producerPage
	},
	
	
];

const routers = new VueRouter({
	routes
});

new Vue({
	el: '#app',
	router,
	routers,
	components: {
		App,
		firstHM,
		introducePage,
		routerPage,
		homePage,
		audiencePage,
		producerPage,
		
	},
	template: '<App/>'
});
